import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by JiaJia on 2019/8/10 0010.
 */
public class Beike04 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int ans=0;
        int num= scanner.nextInt();
        int[] arr=new int[num];
        for (int i = 0; i <num; i++) {
            arr[i]=scanner.nextInt();
        }
        Arrays.sort(arr);
        for (int i = 0; i <num ; i++) {
            int res=find(arr,(double)arr[i]/0.9);
            if (res-i>0)
                ans+=res-i;
        }
        System.out.println(ans);
    }
    private static int find(int[] arr,double target){
        int left=0,right=arr.length;
        while (left<right){
            int mid=left+(right-left)/2;
            if (arr[mid]<=target)
                left=mid+1;
            else right=mid;
        }
        return left-1;
    }

}